
*********************************;
* PROGRAM: Angrist1995_Table2	 ;
* PROGRAMMER: Simone Schaner	 ;
* PURPOSE: Recreates Table 2 of	 ;
*	Angrist (1995)				 ;
* DATE CREATED: 9/30/07			 ;
*********************************;

libname d '/bbkinghome/sschaner/Angrist Work/Web Papers/Angrist_1995/';

data one;
	set d.data8191;

	/*RESTRICTIONS*/
	if (workloc='WBANK' or workloc='GAZA' or workloc='JLEM'
		or workloc='ISRAEL');
	if educ ne .;
	
	workisrl= (workloc='JLEM' or workloc='ISRAEL');
		 if workloc="" then workisrl=.;
	
	ed12= educ=12;
	ed13_15= (13 le educ le 15);
	ed16plus= educ ge 16;
	
	age25_34= 25 le age le 34;
	age35_44= 35 le age le 44;
	age45_54= 45 le age le 54;
	age55_64= 55 le age le 64;
	
	occ02= 0 le occ le 29;
	occ35= 30 le occ le 59;
	occ6= 60 le occ le 69;
	occ78= 70 le occ le 89;
	occ9= 90 le occ le 99;
	
	gazan= region='GAZA';
	djlem=workloc='JLEM';
	camp= sample=3;
	city= sample=1;
	ind= int(ind/10);
	indgroup=0;
		if 1 le ind le 3 then indgroup=1;
		if ind=4 then indgroup=4;
		if ind ge 5 then indgroup=5;
		if ind=8 then indgroup=8;
		
	occ=int(occ/10);
		if 0 le occ le 2 then occgroup=0;
		if 3 le occ le 5 then occgroup=3;
		if occ=6 then occgroup=6;
		if 7 le occ le 8 then occgroup=7;
		if occ=9 then occgroup=9;
		
	if wrkdays>0 then hrsday= 4.35*(hourslw/wrkdays);
	**> if mnthwage<15000;
	if (hrsday>0 and daywage>0) then lnhour=log(daywage)-log(hrsday);
	if mnthwage gt 0 then lnmnth=log(mnthwage);
	if daywage gt 0 then lnday=log(daywage);
	
	keep v36 date educ age year wrkdays hourslw lnmnth lnday mnthwage daywage workisrl ed13_15 ed16plus
		indgroup occgroup ed12 djlem gazan camp city workloc age25_34 age35_44 age45_54 age55_64 
		occ02 occ35 occ6 occ78 occ9;
		
data two;
	set one;
	potex=age-educ-6;
	potex2=potex**2;
	run;
proc sort data=two;
by data year;
run;
	
proc glm data=two;
	title1 'Weight regression: men working in israel, jlem, wbank, gaza';
	weight v36;
	class date year;
	model lnday lnmnth= date year*age25_34 year*age35_44 year*age45_54 year*age55_64 
		year*workisrl year*camp year*gazan year*city djlem year*ed13_15 year*ed16plus/ss3 solution;
	where date ne 91;
	run;